<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function imgLoad()
						{
							console.log("imgLoad()")
							document.images[0].onerror = function(){
								alert("图像不存在");
							}
							document.images[0].src = "test.gif";
						}
					</script>
				</head>
				<body onload="imgLoad()">
					<script type="text/javascript">
						
						// onerror 事件
						window.onerror = function(ms,url,line)
						{
							alert("函数"+ms +"\n"+url+"\n"+line);
							return true;
						}
						
						faa();
						
						function foo()
						{
							console.log("foo()");
						}
		</script>
	</body>
</html>
